﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Joker.Model {
    class OpenForm {
        public static void NewForm(Form father, Form child, bool Hide = true) {
            child.StartPosition = FormStartPosition.CenterScreen;
            child.FormBorderStyle = FormBorderStyle.FixedSingle;
            child.MaximizeBox = false;
            child.ShowIcon = false;
            if (Hide) father.Hide();
            child.ShowDialog();
            father.Show();
        }

        public static void ChildForm(Form father, Form child, Control display = null) {
            child.MdiParent = father;
            if (display != null) child.Parent = display;
            child.FormBorderStyle = FormBorderStyle.None;
            child.WindowState = FormWindowState.Maximized;
            child.ShowInTaskbar = false;
            child.Show();
        }
    }
}
